package org.itboys.mobile.dto;

import org.itboys.admin.dto.lasted.BaseDto;

import java.math.BigDecimal;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 描述：天街_钱包（消费卡）_dto。
 */

public class TianJieWalletDto extends MobileBaseDto{

    private BigDecimal totalAmount;//总业绩。来源，1充值，2拨付，3推荐链上充值
    private BigDecimal unreleaseAmount;//待释放余额。来源：1，充值，2，拨付，3,冻结金额（退出区块链）
    private BigDecimal frozenAmount;//冻结金额。来源：1,待释放金额（托管区块链）
    //可以提现的金额
    private BigDecimal releaseAmount;//已释放金额即周薪（可提现）。来源：1，待释放金额，
    private BigDecimal cashAmount;//现金金额即日薪（可提现）。来源。1,推荐用户充值
    private BigDecimal profitAmount;//区块链收益即理财（可提现）。来源。1，退出区块链时，可用金额超出本金的部分
    //合计可提现金额
    private BigDecimal ableCashAmount;//合计可以提现金额。
    //业绩等级相关
    private BigDecimal totalAchievement;//总业绩
    private BigDecimal scale;//提成折扣;直接写入

  //  private BigDecimal currentRevenue;//当前收益（购买区块链的收益）。2017年11月24日，废弃
   // private BigDecimal presentAmount;//可用拨付金额。队长从团队处继承。
    public TianJieWalletDto() {

    }



    public TianJieWalletDto(long id, String createTime, String createDate,
                            BigDecimal totalAmount, BigDecimal unreleaseAmount, BigDecimal frozenAmount,
                            BigDecimal releaseAmount, BigDecimal cashAmount, BigDecimal profitAmount,
                            BigDecimal ableCashAmount,BigDecimal totalAchievement,BigDecimal scale) {
        super(id, createTime, createDate);
        this.totalAmount = totalAmount;
        this.unreleaseAmount = unreleaseAmount;
        this.frozenAmount = frozenAmount;
        this.releaseAmount = releaseAmount;
        this.cashAmount = cashAmount;
        this.profitAmount = profitAmount;
        this.ableCashAmount=ableCashAmount;
        this.totalAchievement=totalAchievement;
        this.scale=scale;

    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getUnreleaseAmount() {
        return unreleaseAmount;
    }

    public void setUnreleaseAmount(BigDecimal unreleaseAmount) {
        this.unreleaseAmount = unreleaseAmount;
    }

    public BigDecimal getFrozenAmount() {
        return frozenAmount;
    }

    public void setFrozenAmount(BigDecimal frozenAmount) {
        this.frozenAmount = frozenAmount;
    }

    public BigDecimal getReleaseAmount() {
        return releaseAmount;
    }

    public void setReleaseAmount(BigDecimal releaseAmount) {
        this.releaseAmount = releaseAmount;
    }

    public BigDecimal getCashAmount() {
        return cashAmount;
    }

    public void setCashAmount(BigDecimal cashAmount) {
        this.cashAmount = cashAmount;
    }

    public BigDecimal getProfitAmount() {
        return profitAmount;
    }

    public void setProfitAmount(BigDecimal profitAmount) {
        this.profitAmount = profitAmount;
    }

    public BigDecimal getAbleCashAmount() {
        return ableCashAmount;
    }

    public void setAbleCashAmount(BigDecimal ableCashAmount) {
        this.ableCashAmount = ableCashAmount;
    }



    /*public BigDecimal getPresentAmount() {
        return presentAmount;
    }

    public void setPresentAmount(BigDecimal presentAmount) {
        this.presentAmount = presentAmount;
    }*/

    public BigDecimal getTotalAchievement() {
        return totalAchievement;
    }

    public void setTotalAchievement(BigDecimal totalAchievement) {
        this.totalAchievement = totalAchievement;
    }

    public BigDecimal getScale() {
        return scale;
    }

    public void setScale(BigDecimal scale) {
        this.scale = scale;
    }
    //单位万
    public String getTotalAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String totalAmountStr="";
        if(totalAmount.compareTo(tenThousand)==1){
            totalAmountStr=totalAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            totalAmountStr=totalAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return totalAmountStr;
    }
    public String getUnreleaseAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String unreleaseAmountStr="";
        if(unreleaseAmount.compareTo(tenThousand)==1){
            unreleaseAmountStr=unreleaseAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            unreleaseAmountStr=unreleaseAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return unreleaseAmountStr;
    }
    public String getFrozenAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String frozenAmountStr="";
        if(frozenAmount.compareTo(tenThousand)==1){
            frozenAmountStr=frozenAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            frozenAmountStr=frozenAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return frozenAmountStr;
    }
    public String getReleaseAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String releaseAmountStr="";
        if(frozenAmount.compareTo(tenThousand)==1){
            releaseAmountStr=releaseAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            releaseAmountStr=releaseAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return releaseAmountStr;
    }
    public String getCashAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String cashAmountStr="";
        if(cashAmount.compareTo(tenThousand)==1){
            cashAmountStr=cashAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            cashAmountStr=cashAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return cashAmountStr;
    }
    public String getProfitAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String profitAmountStr="";
        if(profitAmount.compareTo(tenThousand)==1){
            profitAmountStr=profitAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            profitAmountStr=profitAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return profitAmountStr;
    }
    public String getAbleCashAmountStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String ableCashAmountStr="";
        if(ableCashAmount.compareTo(tenThousand)==1){
            ableCashAmountStr=ableCashAmount.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            ableCashAmountStr=ableCashAmount.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return ableCashAmountStr;
    }
    public String getTotalAchievementStr(){
        BigDecimal tenThousand=new BigDecimal("10000");
        String totalAchievementStr="";
        if(totalAchievement.compareTo(tenThousand)==1){
            totalAchievementStr=totalAchievement.divide(tenThousand,2,BigDecimal.ROUND_HALF_UP).toString()+"万";
        }else{
            totalAchievementStr=totalAchievement.setScale(2,BigDecimal.ROUND_HALF_UP).toString();
        }
        return totalAchievementStr;
    }

    public String getInfo(){
        return "字段说明：1，totalAmount:总金额，2，unreleaseAmount:待释放金额，" + "3，frozenAmount:冻结金额，" +
                "4，releaseAmount:已释放金额（即周薪）可提现，" +  "4，cashAmount:现金金额（即日薪）可提现，" +"5，profitAmount:现金金额（即理财）可提现，" +
                "6，ableCashAmount:合计可提现金额:"+"7,totalAchievement:总业绩,8,scale:业绩提成比例,9钱包中带Str字符串金额单位为：万（直接取这个字段，不需要再换算，只做显示）";
    }
}
